home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics Plus
/
Graphics Plus.iso
/
amiga
/
animutil
/
kfast
/
kfast.lzh
/
KFAST
/
src
/
memory.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-07-03
|
698b
|
44 lines
#include <exec/types.h>
#include <exec/memory.h>
#include <proto/exec.h>
#include <stdlib.h>
void * mymalloc(ULONG size)
{
void * ptr;
if(size==0) return(NULL);
ptr = malloc(size) /*AllocMem(size,MEMF_PUBLIC)*/;
return(ptr);
}
void * myrealloc(void * old,ULONG size,ULONG oldsize)
{
void * ptr;
if(size==0)
{
free(old)/*FreeMem(old,oldsize)*/;
return(NULL);
}
if(size==oldsize) return(old);
ptr = realloc(old,size)/*AllocMem(size,MEMF_PUBLIC);
if(size>oldsize)
memcpy((char *)ptr,(char *)old,oldsize);
else
memcpy((char *)ptr,(char *)old,size);
FreeMem(old,oldsize)*/;
return(ptr);
}
void myfree(void * ptr, ULONG size)
{
free(ptr)/*FreeMem(ptr,size)*/;
}